package darknet.application.chat.spec;

import darknet.application.chat.impl.net.message.BroadcastChannelMessage;
import darknet.application.chat.impl.net.message.BroadcastExitChannelMessage;
import darknet.application.chat.impl.net.message.BroadcastJoinChannelMessage;
import darknet.application.chat.impl.net.message.CloseChannelMessage;
import darknet.application.chat.impl.net.message.ExitChannelMessage;
import darknet.application.chat.impl.net.message.JoinChannelMessage;

/**
 * Events to handle for a channel observer.
 *
 * @author yoyo
 */
public interface ChannelObserver {

    /**
     * A node has joined a channel.
     *
     * @param message
     */
    void newJoinChannelMessage(JoinChannelMessage event);

    /**
     * A node has joined a channel. Channel hoster notify us.
     *
     * @param message
     */
    void newBroadcastJoinChannelMessage(BroadcastJoinChannelMessage event);

    /**
     * A new message has been post in a joined channel.
     *
     * @param event The event to broadcast.
     */
    void newBroadcastChannelMessage(BroadcastChannelMessage event);

    /**
     * A node has exit a channel.
     * 
     * @param event
     */
    void newExitChannelMessage(ExitChannelMessage event);

    /**
     * A node has exited a joined channel.
     *
     * @param event The event to broadcast.
     */
    void newBroadcastExitChannelMessage(BroadcastExitChannelMessage event);

    /**
     * A joined channel will be closed, because the channel hoster no longer
     * host this channel.
     *
     * @param event The event to broadcast.
     */
    void newCloseChannelMessage(CloseChannelMessage event);
}
